package club.janna.rpcdemo.server.config;

import club.janna.rpcdemo.codec.Codec;
import club.janna.rpcdemo.codec.JavaSerialCodec;
import club.janna.rpcdemo.server.listener.NetListener;
import club.janna.rpcdemo.server.listener.NettyNetListener;
import club.janna.rpcdemo.server.register.ServiceRegister;
import club.janna.rpcdemo.server.register.ZooKeeperServiceRegister;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RPCConfig {
    @Bean
    public ServiceRegister serviceRegister() {
        return new ZooKeeperServiceRegister();
    }

    @Bean
    public NetListener netListener() {
        return new NettyNetListener();
    }

    @Bean
    public Codec codec() {
        return new JavaSerialCodec();
    }
}
